package Factory.idcard;

import Factory.framework.Factory;
import Factory.framework.Product;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>Title IDCardFactory</p>
 *
 * @author YiMing Liu
 * @date 2018/6/9 19:01
 * <p>Description:</p>
 */
public class IDCardFactory extends Factory {

    private List owners = new ArrayList();

    @Override
    public Product createProduct(String owner) {
        return new IDCard(owner);
    }

    @Override
    public void registerProduct(Product product) {
         owners.add(((IDCard)product).getOwner());

    }

    @Override
    public Integer getTotal() {
        return owners.size();
    }

    public List getOwners() {
        return owners;
    }

    public void setOwners(List owners) {
        this.owners = owners;
    }
}
